An IC card receives electrical power and clock signals from a terminal. Thus, if the terminal is turned off or not connected to the IC card, a clock signal is not received. Moreover, even when the IC card is connected to the terminal and powered on, the clock signal is not continuously provided. Moreover, even when the IC card is connected to the terminal and powered on, it does not know the clock frequency of the terminal.
On the other hand, the clock frequency may not be a priori known to the IC card, since it may be connected to several terminals, providing different clock frequencies. Thus, since the IC card does not know the clock frequency, it cannot measure time. Even the most advanced IC cards include only two hardware timers, i.e., an incremental timer and a decrement timer. The decrement timer is loaded with a predetermined value and is decreased at every clock cycle. It may be configured to decrease a pre-scale value at each clock cycle.
FIG. 1 schematically represents an IC card 140 and a terminal wherein the IC card is inserted. The terminal 100 comprises a radio interface, such as an antenna 110, a display 120, and buttons 130. The terminal provides a timer service 150 to the IC card 140.
FIG. 2 represents the internal hardware structure of the IC card. More particularly, the IC card 140 comprises a central processor unit (CPU) 200, a memory 210, a timer 220, an optional internal clock generator 230, and a universal asynchronous receiver/transmitter 240. The IC card 140 further includes interfaces for the terminal, i.e., an external clock interface 250, a data 260 interface and a power interface 270. The interface for data 260 is used for communicating data with the terminal 100 while the interface for power 270 is used for receiving electrical power from the external device 100.
In case the IC card 140 includes an internal clock 230, an application stored in the IC card or the IC card operating system may manage the use of the internal clock 230 independently on the external clock 250 of the terminal or the external clock 250 of the terminal. The internal clock 230 may be emitted by internal hardware of the card, such as an oscillator or a PLL. The external clock is generated outside the IC card 140, e.g, by the terminal 100 through the corresponding interface 250. The frequency of the clock internally generated by the IC card may not be a priori known to the IC card as well, since it may depend on several electrical parameters strictly related to the IC production process, and so may be different for each IC card. This is because of the production tolerances and operating conditions providing different clock frequencies among a well-defined clock frequency interval.
In other words, the problem affecting the known IC card 140 is that it cannot detect the frequency of the clock at runtime. Moreover, different types of clocks can be supplied to the IC card 140 depending on what clock is used at a specific time, i.e., the internal clock or an external clock. For the internal clock frequency, if an internal clock is available, it could be known from the IC card specification. However, due to the fluctuation of the power level and other operating conditions, such as temperature or due to several electrical parameters strictly related to the IC production process and production tolerances, the actual internal clock frequency can be different from the nominal frequency value of the specification, and may be different for each IC card.
Additionally, as depicted in FIG. 3, it may be usual for a terminal to switch off the clock supply when no communication takes place to reduce the IC card current absorption. During the interval 300, 320, the IC card 140 is switched on and can communicate APDU messages with the external device 100. During these time intervals, the timer 220 can be active. However, during the interval 310 when the IC card 140 is still switched on but the external clock is not generated by the terminal 100 for power savings, it is still possible to increase or decrease the timer value.